Menu

Wiki usage

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
Edit Sidebar
Main > LightTypes

Main.LightTypes History

Hide minor edits - Show changes to output

February 19, 2005, at 11:23 AM by bjarne
Changed lines 56-57 from:

textures/leucht/leucht
to:
----
textures/leucht/leucht
{
qer_editorimage textures/leucht/leucht_blend.tga
surfaceparm nomarks
q3map_surfacelight 30000
Changed lines 63-80 from:
qer_editorimage textures/leucht/leucht_blend.tga
surfaceparm nomarks
q3map_surfacelight 30000
{
map $lightmap
rgbGen identity
}
{
map textures/leucht/leucht.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/leucht/leucht_blend.tga
blendfunc GL_ONE GL_ONE
}
}
to:
map $lightmap
rgbGen identity
}
{
map textures/leucht/leucht.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/leucht/leucht_blend.tga
blendfunc GL_ONE GL_ONE
}
}
----
Added line 102:
----
Changed lines 110-119 from:
while(1)
{
wait (randomfloat 2)
$fx_light_01 light 1 1 1 (randomfloat 100+300) //R(0-1) G(0-1) B(0-1) Radius

$fx_corona_01 show
wait (randomfloat 2)
$fx_light_01 light 1 1 1 0 //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 hide
}
to:
while(1)
{
wait (randomfloat 2)
$fx_light_01 light 1 1 1 (randomfloat 100+300) //R(0-1) G(0-1) B(0-1) Radius

$fx_corona_01 show
wait (randomfloat 2)
$fx_light_01 light 1 1 1 0 //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 hide
}
Changed line 121 from:
to:
----
February 19, 2005, at 12:45 AM by Wacko
Changed lines 5-6 from:
This is basically a post I did in the .Map forun that got out of hand. It can be a good introduction to what lights are available in MOH:AA, and how they work.
to:
This is basically a post I did in the .Map forum that got out of hand. It can be a good introduction to what lights are available in MOH:AA, and how they work.
Deleted line 9:
Deleted line 10:
Deleted line 20:
Deleted line 47:
Deleted line 122:
Deleted line 123:
February 19, 2005, at 12:40 AM by Wacko
Changed lines 91-100 from:
!A mixed up example

Attach:final.p.jpg

This looks a bit more interesting than a flat ambientlight, right? :)

For this image I set up these three lights:

'''Red light'''
to:
!!Scripted lights
Another possibility to add light to your map would be to add a script_origin to your map and make it light in the script. This method has its pros and cons. The absolute pro is that you can switch on/off your light by script, even change it's brightness and color. The main disadvantage is, that this light isn't in the map during compilation, which means it doesn't know about walls and shines through them...
Okay, if you don't care, here we go. Add a script_origin where you want the light to be (obviously). Give it
Changed lines 96-100 from:
||light||70||The intensity of the light, default is 300||
||_color||1 0.2 0.2||Light color components (RGB from 0 to 1)||

'''Orange light'''
to:
||model||fx/dummy.tik||The model to use||
||targetname||fx_light_01||its name in the script||
||
Add another script_origin where u want the corona to be. Without a corona, it would look quite strange, so don't forget it.
Changed lines 102-106 from:
||light||30||The intensity of the light, default is 300||
||_color||1 0.5 0||Light color components (RGB from 0 to 1)||

'''Spot light'''
to:
Added lines 140-153:
||light||70||The intensity of the light, default is 300||
||_color||1 0.2 0.2||Light color components (RGB from 0 to 1)||

'''Orange light'''

||border=1
||!Key||!Value||!Explanation||
||light||30||The intensity of the light, default is 300||
||_color||1 0.5 0||Light color components (RGB from 0 to 1)||

'''Spot light'''

||border=1
||!Key||!Value||!Explanation||
February 19, 2005, at 12:18 AM by Wacko
Changed lines 55-56 from:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area the way u want...
to:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.
Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency in emitting light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area the way u want...
In the pictures below, u can see to the left an original light emitting texture which gives the visual effect of light behind a window but which can't brighten the room.
To the right, the small light post is illuminating the area just by its four custom light emitting surfaces. The used images are simple singlecoloured tgas, covering the possibility to have different images for use as the texture and the light emitting thing... Here, for example, the lamp looks rather white (the image leucht.tga) and gives yellowish light (image leucht_blend.tga). Additionally, I added a corona in the center of the lamp.
The shader is a follows:

textures/leucht/leucht
{
qer_editorimage textures/leucht/leucht_blend.tga
surfaceparm nomarks
q3map_surfacelight 30000
{
map $lightmap
rgbGen identity
}
{
map textures/leucht/leucht.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/leucht/leucht_blend.tga
blendfunc GL_ONE GL_ONE
}
}

February 18, 2005, at 08:06 PM by bjarne
Changed lines 57-58 from:
Img:glowing_surface.jpg Img: glowing_shader.jpg
to:
Img:glowing_surface.jpg Img:glowing_shader.jpg
February 18, 2005, at 08:04 PM by bjarne
Changed lines 57-58 from:
Img:glowing_surface.jpg
to:
Img:glowing_surface.jpg Img: glowing_shader.jpg
Changed lines 68-69 from:
Attach:final.jpg
to:
Attach:final.p.jpg
February 18, 2005, at 10:58 AM by Wacko
Changed lines 55-56 from:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area...
to:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area the way u want...
February 18, 2005, at 10:57 AM by Wacko
Changed lines 55-56 from:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face and that value in q3map_surfacelight (value). For small faces you might have to set this value to 10000 or even more, to make them light the area...
to:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area...
February 18, 2005, at 10:15 AM by Wacko
Changed lines 55-56 from:
These are shaders that are made to emitt light from an entire surface. {-But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.-} Hmmm... I thought these surfaces were acting as lights, but the image from a test compile below shows that the surfaces thnselves are light, but that they do not actually light up the surrounding area.
to:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face and that value in q3map_surfacelight (value). For small faces you might have to set this value to 10000 or even more, to make them light the area...
February 17, 2005, at 08:20 PM by bjarne
Added lines 46-49:
Img:sun_std_lightdensity.jpg Img:sun_4_lightdensity.jpg

In the two images above I did actually rip off the celing to let some daylight in. Sun uses the values '''suncolor 70 70 70''' and '''sundirection -42 45 0'''.
Changed lines 55-56 from:
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.
to:
These are shaders that are made to emitt light from an entire surface. {-But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.-} Hmmm... I thought these surfaces were acting as lights, but the image from a test compile below shows that the surfaces thnselves are light, but that they do not actually light up the surrounding area.

Img:glowing_surface.jpg
February 17, 2005, at 07:46 PM by bjarne
Changed lines 66-67 from:
For this image these I set up these lights:
to:
For this image I set up these three lights:
February 17, 2005, at 07:46 PM by bjarne
Changed lines 86-87 from:
||spot_angle||67||||
||target||spot_target||||
to:
||spot_angle||67||Default is 45||
||target||spot_target||'''spot_target''' is the targetname of a '''script_origin''' directly below the light entity||
February 17, 2005, at 07:43 PM by 81.230.138.243
Changed lines 56-60 from:
Img:spot_std_lightdensity.jpg

Img:spot_4_lightdensity.jpg

Attach:final.jpg
to:
Img:spot_std_lightdensity.jpg Img:spot_4_lightdensity.jpg

In these two pictures, I made the point light into a spotlight by giving it a target directly below it ( to set where it is pointing ) and then setting '''spot_angle 65''' ( the default is 45, but I wanted it a bit wider, because it looked better ). The second picture is compiled with the key ''lightdensity 4'' in worldspawn.

!A mixed up example

Attach:final.jpg

This looks a bit more interesting than a flat ambientlight, right? :)

For this image these I set up these lights:

'''Red light'''

||border=1
||!Key||!Value||!Explanation||
||light||70||The intensity of the light, default is 300||
||_color||1 0.2 0.2||Light color components (RGB from 0 to 1)||

'''Orange light'''

||border=1
||!Key||!Value||!Explanation||
||light||30||The intensity of the light, default is 300||
||_color||1 0.5 0||Light color components (RGB from 0 to 1)||

'''Spot light'''

||border=1
||!Key||!Value||!Explanation||
||spot_angle||67||||
||target||spot_target||||
February 17, 2005, at 07:26 PM by 81.230.138.243
Changed line 60 from:
Img:final.jpg
to:
Attach:final.jpg
February 17, 2005, at 07:24 PM by 81.230.138.243
Changed lines 56-60 from:
-- [[Profiles/Bjarne]]
to:
Img:spot_std_lightdensity.jpg

Img:spot_4_lightdensity.jpg

Img:final.jpg
February 17, 2005, at 07:21 PM by 81.230.138.243
Changed lines 27-28 from:
to:
In the following two pictures, I use a standard point light and an ambientlight (''ambientlight 10 10 10'').
Added lines 31-32:
In the picture above I use all standard light settings. Way nicer than only using ambientlight, right?
Added lines 35-42:
In the picture above I have set the key ''lightdensity 4'' in worldspawn. This means that the resolution of the shadows generated by the light compiler will be higher, creating more distinct shadows. This is generally not a good idea, as the light compile will be a '''LOT''' longer ( and some compiles may even fail because it cant handle the huge amounts of light data ).

But you dont have to set it for the entire map: you can just select some extra visible faces and do this:

Img:surface_properties.gif

As you see in the [[SurfacePropertiesDialog|surface properties dialog]] above, you can set the '''Density''' of a surface, giving it a sharper shadowing.
February 17, 2005, at 06:59 PM by 81.230.138.243
Changed lines 16-17 from:
Img:ambient_10.jpg Img:ambient_40.jpg
to:
Img:ambient_10.jpg

This image is a room lit only with the light: ''ambientlight 10 10 10''. If you look at the large version of it, you '''may''' be able to see the stones. This or maby a bit higher is good for a map where you want some dark corners.

Img:ambient_40.jpg

This second image is the same room lit only with the light: ''ambientlight 40 40 40''. As you can see, it looks veeeery boring. This level is great if you want a map that looks like crap, or takes place in a very brightly lit area.
Added lines 27-31:

Img:point_std_lightdensity.jpg

Img:point_4_lightdensity.jpg
February 17, 2005, at 06:50 PM by 81.230.138.243
Added lines 16-17:
Img:ambient_10.jpg Img:ambient_40.jpg
February 17, 2005, at 02:07 AM by 81.230.138.243
Added lines 3-4:
'''Still left to do: Add example pictures to tutorial.'''
February 16, 2005, at 11:19 PM by bjarne
Added lines 1-30:
!Light types in MOH:AA

This is basically a post I did in the .Map forun that got out of hand. It can be a good introduction to what lights are available in MOH:AA, and how they work.

(:toc:)

!Basic light types

There are 3 basic light types:

!!Ambient light
This light is applied to everything in the entire map. This value dictates the absolute darkest there can be in a map. A sealed off room with no openings will have only this light.

!!Point light
Basically "lightbulbs". They radiate light equally in all directions from a singular point ( hence the name I guess ). A sealed off room with no openings and a point light will have this light + the ambient light.

!!Sunlight
As opposed to point light: this light is parallell to in a single direction ( an approximation of the light from the sun ( real sunlight is not paralell, but the few rays that reach us are pretty far from the sun, so considering it paralell vill be easier to compute and the human eye does not notice a difference ) ). A sealed off room with no openings Will have none of this light. But rip off the roof an it will probably get some ( if you have set the sunlight to come from above atleast... )

!Other lights

There are other lights that are really not separate light types. Rather they are lighting effects created out of the basic light types.

!!Light emitting surfaces
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.

!!Spotlights
These are a specially configured point light (made to light up a cone from the point light source), its not really a type by itself. Think of it as a lightbulb at the bottom of a cone of some material that blocks light, creating a "light cone".

-- [[Profiles/Bjarne]]

Recent Changes Printable View Page History Edit Page [Attributes] [Printable View] [WikiHelp]
Page last modified on February 19, 2005, at 11:23 AM